Optimal. Leaf size=67 \[ \frac{2 a d (c+d x) \cos (e+f x)}{f^2}+\frac{a (c+d x)^2 \sin (e+f x)}{f}+\frac{a (c+d x)^3}{3 d}-\frac{2 a d^2 \sin (e+f x)}{f^3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0845239, antiderivative size = 67, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 3, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3317, 3296, 2637} \[ \frac{2 a d (c+d x) \cos (e+f x)}{f^2}+\frac{a (c+d x)^2 \sin (e+f x)}{f}+\frac{a (c+d x)^3}{3 d}-\frac{2 a d^2 \sin (e+f x)}{f^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3317
Rule 3296
Rule 2637
Rubi steps
\begin{align*} \int (c+d x)^2 (a+a \cos (e+f x)) \, dx &=\int \left (a (c+d x)^2+a (c+d x)^2 \cos (e+f x)\right ) \, dx\\ &=\frac{a (c+d x)^3}{3 d}+a \int (c+d x)^2 \cos (e+f x) \, dx\\ &=\frac{a (c+d x)^3}{3 d}+\frac{a (c+d x)^2 \sin (e+f x)}{f}-\frac{(2 a d) \int (c+d x) \sin (e+f x) \, dx}{f}\\ &=\frac{a (c+d x)^3}{3 d}+\frac{2 a d (c+d x) \cos (e+f x)}{f^2}+\frac{a (c+d x)^2 \sin (e+f x)}{f}-\frac{\left (2 a d^2\right ) \int \cos (e+f x) \, dx}{f^2}\\ &=\frac{a (c+d x)^3}{3 d}+\frac{2 a d (c+d x) \cos (e+f x)}{f^2}-\frac{2 a d^2 \sin (e+f x)}{f^3}+\frac{a (c+d x)^2 \sin (e+f x)}{f}\\ \end{align*}
Mathematica [A] time = 0.334301, size = 80, normalized size = 1.19 \[ a \left (\frac{\left (c^2 f^2+2 c d f^2 x+d^2 \left (f^2 x^2-2\right )\right ) \sin (e+f x)}{f^3}+c^2 x+\frac{2 d (c+d x) \cos (e+f x)}{f^2}+c d x^2+\frac{d^2 x^3}{3}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.04, size = 236, normalized size = 3.5 \begin{align*}{\frac{1}{f} \left ({\frac{a{d}^{2} \left ( \left ( fx+e \right ) ^{2}\sin \left ( fx+e \right ) -2\,\sin \left ( fx+e \right ) +2\, \left ( fx+e \right ) \cos \left ( fx+e \right ) \right ) }{{f}^{2}}}+2\,{\frac{acd \left ( \cos \left ( fx+e \right ) + \left ( fx+e \right ) \sin \left ( fx+e \right ) \right ) }{f}}-2\,{\frac{a{d}^{2}e \left ( \cos \left ( fx+e \right ) + \left ( fx+e \right ) \sin \left ( fx+e \right ) \right ) }{{f}^{2}}}+a{c}^{2}\sin \left ( fx+e \right ) -2\,{\frac{acde\sin \left ( fx+e \right ) }{f}}+{\frac{a{d}^{2}{e}^{2}\sin \left ( fx+e \right ) }{{f}^{2}}}+{\frac{a{d}^{2} \left ( fx+e \right ) ^{3}}{3\,{f}^{2}}}+{\frac{acd \left ( fx+e \right ) ^{2}}{f}}-{\frac{a{d}^{2}e \left ( fx+e \right ) ^{2}}{{f}^{2}}}+a{c}^{2} \left ( fx+e \right ) -2\,{\frac{acde \left ( fx+e \right ) }{f}}+{\frac{a{d}^{2}{e}^{2} \left ( fx+e \right ) }{{f}^{2}}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.21301, size = 317, normalized size = 4.73 \begin{align*} \frac{3 \,{\left (f x + e\right )} a c^{2} + \frac{{\left (f x + e\right )}^{3} a d^{2}}{f^{2}} - \frac{3 \,{\left (f x + e\right )}^{2} a d^{2} e}{f^{2}} + \frac{3 \,{\left (f x + e\right )} a d^{2} e^{2}}{f^{2}} + \frac{3 \,{\left (f x + e\right )}^{2} a c d}{f} - \frac{6 \,{\left (f x + e\right )} a c d e}{f} + 3 \, a c^{2} \sin \left (f x + e\right ) + \frac{3 \, a d^{2} e^{2} \sin \left (f x + e\right )}{f^{2}} - \frac{6 \, a c d e \sin \left (f x + e\right )}{f} - \frac{6 \,{\left ({\left (f x + e\right )} \sin \left (f x + e\right ) + \cos \left (f x + e\right )\right )} a d^{2} e}{f^{2}} + \frac{6 \,{\left ({\left (f x + e\right )} \sin \left (f x + e\right ) + \cos \left (f x + e\right )\right )} a c d}{f} + \frac{3 \,{\left (2 \,{\left (f x + e\right )} \cos \left (f x + e\right ) +{\left ({\left (f x + e\right )}^{2} - 2\right )} \sin \left (f x + e\right )\right )} a d^{2}}{f^{2}}}{3 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.63074, size = 228, normalized size = 3.4 \begin{align*} \frac{a d^{2} f^{3} x^{3} + 3 \, a c d f^{3} x^{2} + 3 \, a c^{2} f^{3} x + 6 \,{\left (a d^{2} f x + a c d f\right )} \cos \left (f x + e\right ) + 3 \,{\left (a d^{2} f^{2} x^{2} + 2 \, a c d f^{2} x + a c^{2} f^{2} - 2 \, a d^{2}\right )} \sin \left (f x + e\right )}{3 \, f^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.785503, size = 151, normalized size = 2.25 \begin{align*} \begin{cases} a c^{2} x + \frac{a c^{2} \sin{\left (e + f x \right )}}{f} + a c d x^{2} + \frac{2 a c d x \sin{\left (e + f x \right )}}{f} + \frac{2 a c d \cos{\left (e + f x \right )}}{f^{2}} + \frac{a d^{2} x^{3}}{3} + \frac{a d^{2} x^{2} \sin{\left (e + f x \right )}}{f} + \frac{2 a d^{2} x \cos{\left (e + f x \right )}}{f^{2}} - \frac{2 a d^{2} \sin{\left (e + f x \right )}}{f^{3}} & \text{for}\: f \neq 0 \\\left (a \cos{\left (e \right )} + a\right ) \left (c^{2} x + c d x^{2} + \frac{d^{2} x^{3}}{3}\right ) & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.17491, size = 127, normalized size = 1.9 \begin{align*} \frac{1}{3} \, a d^{2} x^{3} + a c d x^{2} + a c^{2} x + \frac{2 \,{\left (a d^{2} f x + a c d f\right )} \cos \left (f x + e\right )}{f^{3}} + \frac{{\left (a d^{2} f^{2} x^{2} + 2 \, a c d f^{2} x + a c^{2} f^{2} - 2 \, a d^{2}\right )} \sin \left (f x + e\right )}{f^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]